<?php

	!strlen($this->row['name'])
		or $this->headTitle($this->row['name']);
	
	/* @var $headMeta Zend_View_Helper_HeadMeta */
	$headMeta = $this->getHelper('headMeta');
	
	!strlen($this->row['meta_keywords'])
		or $headMeta->setName('keywords', $this->row['meta_keywords']);

	!strlen($this->row['meta_description'])
		or $headMeta->setName('description', $this->row['meta_description']);

?>
<div class="kx_shop_product kx_display <?php print $this->row['promotion'] ? 'kx_promotion' : ''?>">
	<div class="kx_head">
		<h1 class="kx_title"><?php print $this->escape($this->row['name'])?></h1>
		<div>
			<span class="kx_price">
				<?php if ($this->row['promotion']):?>
					<del><?php print $this->price($this->row['price'])?></del>
				<?php endif;?>

				<?php print $this->price($this->row['price'], $this->row['modifer'],$this->row['value'])?> 
				zł
			</span>

			<a class="ks_action_addToCart" rel="nofallow" href="<?php print $this->url(array('alias' => $this->row['alias']),'shop-cart-add', true)?>"><span>Dodaj do koszyka &raquo;</span></a>
		</div>
	</div>
	
	<div class="kx_content">

		<div class="kx_summary">
			<p class="kx_product_info"> <b>Producent</b> <a class="kx_manufacturer" href="<?php print $this->url(array('alias' => $this->manufacturer['alias']), 'shop-manufacturer', true)?>"><?php print $this->escape($this->manufacturer['name'])?></a></p>

			<?php if (count($this->attribs)):?>
			<div class="kx_attribs">
				<h5 class="kx_title">Cechy produktu:</h5>
				<ul class=" kx_list">
					<?php foreach ($this->attribs as $attrib):?>
					<li class="kx_item"><span class="kx_label" title="<?php print $this->escape($attrib['description'])?>"><?php print $attrib['name']?>:</span> <span class="kx_value"><?php print ('' == $attrib['value']) ? $attrib['default'] : $attrib['value']?></span></li>
					<?php endforeach;;?>
				</ul>
			</div>
			<?php endif;?>
	
		<p><a class="kx_action_back" href="javascript:history.back();"> &laquo; Powrót do poprzedniej strony</a></p>


			<?php print $this->row['summary']?>
		</div>

		<?php
			$image = $this->findMainImage($this->images, $this->row);
			$imgMain = @$image['image'];
			$alt = isset($image['name']) ? $image['name'] : $img;
		?>

		<div class="kx_image_main">
			<?php if(count($this->images)):?>
			<a href="upload/shop/product/preview/<?php print $imgMain?>" title="Powiększ zdięcie" rel="lightbox">
				<img src="upload/shop/product/medium_width/<?php print $imgMain?>" alt="<?php print $alt?>"/></a>
	
			<div class="kx_images kx_wrapper">	
				<div class="container">
					<ul class="slides">
					<?php foreach((array) $this->images as $image):
						$img = $this->escape($image['image']);
						$alt = $this->escape(
							strlen($image['name'] > 1 ? $image['name'] : $image['image'] )
						);
						
						if ($imgMain == $img) 
						{
							continue;
						}
					?>
					<li class="kx_item">
						<a href="upload/shop/product/preview/<?php print $img?>" title="Powiększ zdięcie" rel="lightbox">
							<img src="upload/shop/product/small_crop/<?php print $img?>" alt="<?php print $alt?>"/></a></li>
					<?php endforeach;?>
					</ul>
				</div><!-- .container -->

				<a href="#" class="previous">previous</a>
				<a href="#" class="next">next</a>
				<div class="clear"></div>
			</div><!-- // .kx_images -->
			<?php endif;?>
			<div class="clear"></div>
		</div><!-- // .kx_image_main -->
	</div>
	
	<div class="clear"></div>
		
	<div class="kx_tabs">
		<ul>
			<li><a href="#tabs-1">Dodatkowe informacje</a></li>
		</ul>
		<div id="tabs-1" class="kx_description">
			<div class="kx_wrapper">
				<?php print $this->row['description']?>
			</div>
		</div>
	</div>
</div>